﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Xiaowei.Converters
{
    public class BoolValueSelector : IValueConverter
    {
        public List<object> TargetValueList { get; } = new List<object>();

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool flag && TargetValueList.Count >= 2)
            {
                if (flag)
                {
                    return TargetValueList[0];
                }
                else
                {
                    return TargetValueList[1];
                }
            }
            else
            {
                return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
